<?php
/**
 * Created by PhpStorm.
 * User: xuewl
 * Date: 2018/1/3
 * Time: 19:10
 */

namespace app\product\model;
use app\common\library\Model;

class ProductOrderComplain extends Model
{
    protected $append = ['result_name'];

    public function userInfo() {
        return $this->hasOne("app\\user\\model\\User", "id", "user_id");
    }

    public function customerInfo() {
        return $this->hasOne("app\\user\\model\\User", "id", "customer_id");
    }

    public function getResultNameAttr($value, $data) {
        $arr = ['0' => '待处理', '1' => '已处理'];
        return $arr[$data['result']];
    }


}
